<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Register</title>
        <style>
            .errorMessage {
                color: red;
                font-size: 0.8em;
            } 
        </style>
        
    </h:head>
    <h:body>
        <c:if test="#{register.dangkithanhcong ==true}">
            <h:outputText value="Bạn đã Đăng Kí Thành Công."/><br/>
            <h:outputText value="Mời Bạn Đăng Nhập."/> <br/>
            <h:commandLink value="Trang Chu." action=""/>          
        </c:if>
        <c:if test="#{register.dangkithanhcong ==false}">
            <h:form>


                <table width="746" border="0">
                    <tr>
                        <td width="333" bgcolor="#CCCCCC"><strong>Thông tin cá nhân</strong></td>
                        <td width="145">&nbsp;</td>
                        <td width="149">&nbsp;</td>
                        <td width="185">&nbsp;</td>
                        <td width="306">&nbsp;</td>
                    </tr>
                    <tr>
                        <td><div align="center">Họ tên của bạn</div></td>
                        <td colspan="2">

                            <div align="center">
                                <h:inputText id="hoten" value="#{register.hoten}" required="true"
                                             binding="#{hoten}"
                                             requiredMessage="Bạn chưa điền họ tên." >
                                </h:inputText>

                            </div>

                        </td>
                        <td>&nbsp;</td>
                        <td> <h:message for="hoten" style="color: red;" /></td>

                    </tr>
                    <tr>
                        <td><div align="center">Ngày sinh</div></td>
                        <div align="center"> 
                            <td width="200">
                                Ngày
                                <h:selectOneMenu value="#{register.ngaysinh}">
                                    <f:selectItem itemValue="1"/>
                                    <f:selectItem itemValue="2"/>
                                    <f:selectItem itemValue="3"/>
                                    <f:selectItem itemValue="4"/>
                                    <f:selectItem itemValue="5"/>
                                    <f:selectItem itemValue="6"/>
                                    <f:selectItem itemValue="7"/>
                                    <f:selectItem itemValue="8"/>
                                    <f:selectItem itemValue="9"/>
                                    <f:selectItem itemValue="10"/>
                                    <f:selectItem itemValue="11"/>
                                    <f:selectItem itemValue="12"/>
                                    <f:selectItem itemValue="13"/>
                                    <f:selectItem itemValue="14"/>
                                    <f:selectItem itemValue="15"/>
                                    <f:selectItem itemValue="16"/>
                                    <f:selectItem itemValue="17"/>
                                    <f:selectItem itemValue="18"/>
                                    <f:selectItem itemValue="19"/>
                                    <f:selectItem itemValue="20"/>
                                    <f:selectItem itemValue="21"/>
                                    <f:selectItem itemValue="22"/>
                                    <f:selectItem itemValue="23"/>
                                    <f:selectItem itemValue="24"/>
                                    <f:selectItem itemValue="25"/>
                                    <f:selectItem itemValue="26"/>
                                    <f:selectItem itemValue="27"/>
                                    <f:selectItem itemValue="28"/>
                                    <f:selectItem itemValue="29"/>
                                    <f:selectItem itemValue="30"/>
                                    <f:selectItem itemValue="31"/>                                 
                                </h:selectOneMenu>
                            </td>

                           <td>
                                Tháng
                                <h:selectOneMenu value="#{register.thangsinh}">
                                    <f:selectItem itemValue="1"/>
                                    <f:selectItem itemValue="2"/>
                                    <f:selectItem itemValue="3"/>
                                    <f:selectItem itemValue="4"/>
                                    <f:selectItem itemValue="5"/>
                                    <f:selectItem itemValue="6"/>
                                    <f:selectItem itemValue="7"/>
                                    <f:selectItem itemValue="8"/>
                                    <f:selectItem itemValue="9"/>
                                    <f:selectItem itemValue="10"/>
                                    <f:selectItem itemValue="11"/>
                                    <f:selectItem itemValue="12"/>
                                </h:selectOneMenu>

                            </td>
                            <td colspan="2">
                                Năm                               
                                <h:selectOneMenu value="#{register.namsinh}">
                                    <f:selectItem itemValue="1985"/>
                                    <f:selectItem itemValue="1986"/>
                                    <f:selectItem itemValue="1987"/>
                                    <f:selectItem itemValue="1988"/>
                                    <f:selectItem itemValue="1989"/>
                                    <f:selectItem itemValue="1990"/>
                                    <f:selectItem itemValue="1991"/>
                                    <f:selectItem itemValue="1992"/>
                                    <f:selectItem itemValue="1993"/>
                                    <f:selectItem itemValue="1994"/>
                                    <f:selectItem itemValue="1995"/>
                                    <f:selectItem itemValue="1996"/>
                                    <f:selectItem itemValue="1997"/>
                                    <f:selectItem itemValue="1998"/>
                                    <f:selectItem itemValue="1999"/>
                                    <f:selectItem itemValue="2000"/>
                                    <f:selectItem itemValue="2001"/>
                                    <f:selectItem itemValue="2002"/>
                                    <f:selectItem itemValue="2003"/>
                                    <f:selectItem itemValue="2004"/>
                                    <f:selectItem itemValue="2005"/>
                                    <f:selectItem itemValue="2006"/>
                                    <f:selectItem itemValue="2007"/>
                                    <f:selectItem itemValue="2008"/>
                                    <f:selectItem itemValue="2009"/>
                                    <f:selectItem  itemValue="1000" itemLabel="other year!"/>                          
                                </h:selectOneMenu>
                            </td>
                        </div>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><div align="center">Bạn sống tại</div></td>
                        <td colspan="2">

                            <div align="center">                                
                                <h:selectOneMenu value="#{register.noisong}">
                                    <f:selectItem itemValue="An Giang"/>
                                    <f:selectItem itemValue="Bà Rịa Vũng Tàu"/>
                                    <f:selectItem itemValue="Bắc Cạn"/>
                                    <f:selectItem itemValue="Bắc Giang"/>
                                    <f:selectItem itemValue="Bạc Liêu"/>
                                    <f:selectItem itemValue="Bắc Ninh"/>
                                    <f:selectItem itemValue="Bến Tre"/>
                                    <f:selectItem itemValue="Bình Định"/>
                                    <f:selectItem itemValue="Bình Dương"/>
                                    <f:selectItem itemValue="Bình Phước"/>
                                    <f:selectItem itemValue="Bình Thuận"/>
                                    <f:selectItem itemValue="Cà Mau"/>
                                    <f:selectItem itemValue="Cần Thơ"/>
                                    <f:selectItem itemValue="Cao Bằng"/>
                                    <f:selectItem itemValue="Đà Nẵng"/>
                                    <f:selectItem itemValue="Đăk Lăk"/>
                                    <f:selectItem itemValue="Điện Biên"/>
                                    <f:selectItem itemValue="Đồng Nai"/>
                                    <f:selectItem itemValue="Đồng Tháp"/>
                                    <f:selectItem itemValue="Gia Lai"/>
                                    <f:selectItem itemValue="Hà Đông"/>
                                    <f:selectItem itemValue="Hà Giang"/>
                                    <f:selectItem itemValue="Hạ Long"/>
                                    <f:selectItem itemValue="Hà Nam"/>
                                    <f:selectItem itemValue="Hà Nội"/>
                                    <f:selectItem itemValue="Hà Tây"/>
                                    <f:selectItem itemValue="Hà Tĩnh"/>
                                    <f:selectItem itemValue="Hải Dương"/>
                                    <f:selectItem itemValue="Hải Phòng"/>
                                    <f:selectItem itemValue="Hồ Chí Minh"/>
                                    <f:selectItem itemValue="Hòa Bình"/>                                 
                                    <f:selectItem itemValue="Hưng Yên"/>    
                                    <f:selectItem itemValue="Khánh Hòa"/>    
                                    <f:selectItem itemValue="Kiên Giang"/>    
                                    <f:selectItem itemValue="KonTum"/>    
                                    <f:selectItem itemValue="Lai Châu"/>    
                                    <f:selectItem itemValue="Lâm Đồng"/>    
                                    <f:selectItem itemValue="Lạng Sơn"/>    
                                    <f:selectItem itemValue="Lào Cai"/>    
                                    <f:selectItem itemValue="Long An"/>    
                                    <f:selectItem itemValue="Nam Định"/>    
                                    <f:selectItem itemValue="Nghệ An"/>   
                                    <f:selectItem itemValue="Ninh Bình"/>    
                                    <f:selectItem itemValue="Ninh Thuận"/>    
                                    <f:selectItem itemValue="Phú Yên"/>    
                                    <f:selectItem itemValue="Quảng Bình"/>    
                                    <f:selectItem itemValue="Quảng Nam"/>    
                                    <f:selectItem itemValue="Quảng Ngãi"/>    
                                    <f:selectItem itemValue="Quảng Ninh"/>    
                                    <f:selectItem itemValue="Quảng Trị"/>    
                                    <f:selectItem itemValue="Sóc Trăng"/>    
                                    <f:selectItem itemValue="Sơn La"/>    
                                    <f:selectItem itemValue="Tây Ninh"/>    
                                    <f:selectItem itemValue="Thái Bình"/>    
                                    <f:selectItem itemValue="Thái Nguyên"/>    
                                    <f:selectItem itemValue="Thanh Hóa"/>  
                                    <f:selectItem itemValue="Thừa Thiên Huế"/>  
                                    <f:selectItem itemValue="Tiền Giang"/>  
                                    <f:selectItem itemValue="Trà Vinh"/>  
                                    <f:selectItem itemValue="Tuyên Quang"/>  
                                    <f:selectItem itemValue="Vĩnh Long"/>   
                                    <f:selectItem itemValue="Vĩnh Phúc"/>  
                                    <f:selectItem itemValue="Yên Bái"/>   
                                    <f:selectItem itemValue="Nơi khác"/>  
                                </h:selectOneMenu>
                            </div>
                        </td>
                        <td>&nbsp;</td>


                    </tr>
                    <tr>
                        <td bgcolor="#CCCCCC"><strong>Thông tin tài khoản</strong></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><div align="center">Tên đăng nhập</div></td>
                        <td colspan="2">
                            <div align="center">
                                <h:inputText id="tendangnhap" value="#{register.tendangnhap}" required="true"
                                             requiredMessage="Bạn chưa điền Tên Đăng Nhập." >
                                    <f:validator validatorId="TDNvalidator"/>
                                    <f:attribute name="hoten" value="#{hoten}" />
                                    <f:attribute name="ngay" value="#{ngay}" />
                                    <f:attribute name="thang" value="#{thang}" />
                                    <f:attribute name="nam" value="#{nam}" />
                                    <f:attribute name="noisong" value="#{sRegionIssue1}" />
                                </h:inputText>

                            </div>

                        </td>
                        <td>&nbsp;</td>
                        <td> <h:message for="tendangnhap" style="color: red;" /></td>
                    </tr>
                    <tr>
                        <td><div align="center">Mật khẩu</div></td>                           

                        <td colspan="2">
                            <div align="center"><h:inputSecret id="password" value="#{register.pass}" required="true"
                                                               requiredMessage="Bạn chưa nhâp password">
                                    <f:validator validatorId="PasswordValidator" />
                                    <f:attribute name="conpassword" value="#{conpassword}" />
                                </h:inputSecret>

                            </div>
                        </td>
                        <td>&nbsp;</td>
                        <td> <h:message for="password" style="color: red;" /></td>
                    </tr>
                    <tr>
                        <td><div align="center">Xác nhận mật khẩu</div></td>
                        <td colspan="2">

                            <div align="center">
                                <h:inputSecret id="conpassword" value="#{register.conpass}" required="true"
                                               binding="#{conpassword}"
                                               requiredMessage="Bạn chưa nhâp password confirm">

                                </h:inputSecret>



                            </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>  <h:message for="conpassword" style="color: red;" /></td>
                    </tr>
                    <tr>
                        <td bgcolor="#CCCCCC"><strong>Mã kiểm tra</strong></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><div align="center">Mã kiểm tra</div></td>                        

                        <td></td>
                        <td width="400">
                                <img src="captcha.jpg"/>
                           </td>
                        <td>&nbsp;</td>  

                    </tr>
                    <tr>
                        <td><div align="center">Nhập mã kiểm tra</div></td>
                        <td colspan="2">
                            <label for="makiemtra"></label>
                            <div align="center">
                                <h:inputText id="makt" required="true"
                                             requiredMessage="Bạn chưa điền capcha" >
                                     <f:validator validatorId="capchaValidator"/>
                                </h:inputText>

                            </div>
                        </td>
                        <td>&nbsp;</td>
                        <td> <h:message for="makt" style="color: red;" /></td>

                    </tr>
                    <tr>

                        <td><h:commandLink value="Điều Khoản" action="#{page.setpage('DieuKhoan')}" /></td>
                        <td colspan="2">
                            <h:outputLabel  for="dongy" value="Tôi đã đọc và đồng ý đăng ký !"/>
                            <h:selectBooleanCheckbox id="dongy" >
                                <f:validator validatorId="checkDongy"/>
                            </h:selectBooleanCheckbox>

                        </td>
                        <td>&nbsp;</td>
                        <td>     <h:message for="dongy" style="color: red;" /></td>

                    </tr>
                    <tr>
                        <td height="81">&nbsp;</td>
                        <td colspan="2">
                            <div align="center">
                                <h:commandButton value="Đăng Ký" action="#{register.setTaiKhoan()}"/>
                            </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </h:form>
        </c:if>

    </h:body>
</html>

